package com.example.runtime;

import java.util.Arrays;
import java.util.List;
import java.util.Objects;
import java.util.Scanner;

/**
 * @author 01
 * @date 2019-10-05
 **/
public class Main {

    public static void main(String[] args) {
        CommandRunner commandRunner = new CommandRunner();
        Scanner scanner = new Scanner(System.in);

        String line;
        // 只要输入的不是quit就一直运行
        while (!Objects.equals(line = scanner.nextLine(), "quit")) {
            String[] inputs = line.split("\\W");
            List<Object> inputArgs = Arrays.asList(Arrays.copyOfRange(inputs, 2, inputs.length));
            commandRunner.run(inputs[0], inputs[1], inputArgs);
        }
    }
}
